package cn.itcast.crm.service;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {

	// 查询所有未关联客户列表
	@GET
	@Path("/findNoAssociationCustomers")
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	// 已经关联到指定定区的客户列表
	@GET
	@Path("/findHasAssociationFixedAreaCustomers/{fixedAreaId}")
	@Consumes({ "application/xml", "application/json" })
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedAreaId") String fixedAreaId);

	// 将客户关联到定区上 ， 将所有客户id 拼成字符串 1,2,3，使用@QueryParam实现:不需要指定在path里
	@PUT
	@Path("/associationCustomersToFixedArea")
	@Consumes({ "application/xml", "application/json" })
	public void associationCustomersToFixedArea(@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// customer_findAssociation.action?fixedAreaId="+rowData.id,
	// 查询关联的客户列表:双击显示
	@GET
	@Path("/customer_findAssociation/{fixedAreaId}")
	@Consumes({ "application/xml", "application/json" })
	@Produces({ "application/xml", "application/json" })
	public List<Customer> customer_findAssociation(@PathParam("fixedAreaId") String fixedAreaId);

	@POST
	@Path("/customer")
	@Consumes({ "application/xml", "application/json" })
	public void regist(Customer customer);
	
	//使用手机号查询激活状态
	@GET
	@Path("/customer/telephone/{telephone}")
	@Consumes({ "application/xml", "application/json" })
	@Produces({ "application/xml", "application/json" })
	public Customer activeMail(@PathParam("telephone") String telephone);
	
	//使用手机号查询更改激活状态
	@PUT
	@Path("/customer/updatetype/{telephone}")
	@Consumes({ "application/xml", "application/json"})
	public void customer_updateType(@PathParam("telephone") String telephone);
	
	//用户登陆
	@GET
	@Path("/customer/login")
	@Consumes({ "application/xml", "application/json"})
	@Produces({ "application/xml", "application/json"})
	public Customer login(@QueryParam("telephone") String telephone,@QueryParam("password") String password);
	
	//通过客户ID和寄件人地址获取定区ID
	@GET
	@Path("/findFixAreaIdByAddressAndID")
	@Consumes({ "application/xml", "application/json"})
	@Produces({ "application/xml", "application/json"})
	public String findFixAreaIdByAddressAndID(@QueryParam("id") Integer id,@QueryParam("address") String address);



}
